class Solution(object):
    def minimumSize(self, nums, maxOperations):
        right = max(nums)
        left = 1

        def search(val):
            op = 0
            for num in nums:
                if num > val:
                    op += (num - 1) // val
            return op <= maxOperations

        while left < right:
            mid = (left + right) // 2
            if search(mid):
                right = mid
            else:
                left = mid + 1

        return right
